package com.kuaimacode.kframework.admin.vo.response;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author qinyong
 * @Title:
 * @Package com.kuaimacode.kframework.admin.vo.response
 * @Description: created by IntelliJ IDEA
 * @date 2019-07-30 11:23
 */
@Data
public class AgentOrderResp {
    /**
     * 交易日期
     */
    private Date tranTime;
    /**
     * 交易类型
     */
    private String tranType;
    /**
     * 平台收益
     */
    private BigDecimal platformIncome;
    /**
     * 分站收益
     */
    private BigDecimal agentIncome;
    /**
     * 师傅收益
     */
    private BigDecimal masterIncome;
    /**
     * 优惠款
     */
    private BigDecimal offer;
    /**
     * 未入账
     */
    private BigDecimal notAccounted;
    /**
     * 有效单数
     */
    private Long validCount;
    /**
     * 无效单数
     */
    private Long invalidCount;

    public static AgentOrderResp defaultInstance() {
        AgentOrderResp resp = new AgentOrderResp();
        resp.setPlatformIncome(BigDecimal.ZERO);
        resp.setAgentIncome(BigDecimal.ZERO);
        resp.setMasterIncome(BigDecimal.ZERO);
        resp.setOffer(BigDecimal.ZERO);
        resp.setNotAccounted(BigDecimal.ZERO);
        resp.setValidCount(0L);
        resp.setInvalidCount(0L);
        return resp;
    }

    public String exchangeTranType() {
        if ("1".equals(tranType)) {
            return "跑腿";
        } else if ("2".equals(tranType)) {
            return "其他";
        } else {
            return "全部";
        }
    }
}
